package com.ruoyi.eam.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.eam.doman.EamType;
import com.ruoyi.eam.doman.User;
import com.ruoyi.eam.service.IEamTypeService;
import com.ruoyi.eam.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/types")
public class EamTypeController extends BaseController {

    @Autowired
    private IEamTypeService iEamTypeService;


    //根据类型编号查找指定类型
    @GetMapping(value = "{typeId}")
    public AjaxResult selectEamTypeByTypeId(@PathVariable Long typeId){
        return success(iEamTypeService.selectEamTypeByTypeId(typeId));
    }

    //查询类型
    @GetMapping(value = "/list")
    public TableDataInfo selectEamTypeList(EamType eamType){
        return getDataTable(iEamTypeService.selectEamTypeList(eamType));
    }

}
